package com.xhsj.user.pms.patent.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xhsj.user.pms.patent.domain.ExamineModel;
import com.xhsj.user.pms.patent.domain.Patent;
import com.xhsj.user.pms.patent.query.PatentFindPatentListQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface PatentMapper extends BaseMapper<Patent> {

    IPage<Patent> findList(IPage<ExamineModel> page, @Param("name") String name, @Param("status") String status);
    //根据内部编号修改专利文件
    int updatePatenByNum(@Param("patent") Patent patent);

    Patent getByNum(@Param("num") String num);

//    List<Map<String, Object>> findPatentList(@Param("userId") Object userId, @Param("phaseStatus") Object phaseStatus,
//                                             @Param("startDate") Object startDate, @Param("endDate") Object endDate,
//                                             @Param("archivesNum") String archivesNum,@Param("num") Object num );

    List<Map<String, Object>> findPatentList(@Param("entity") PatentFindPatentListQuery entity);

    IPage<Map<String, Object>> findDiscList(Page<Map<String, Object>> page,
                                            @Param("entity") PatentFindPatentListQuery entity,
                                            @Param("phaseStatusList") List<String> phaseStatusList,
                                            @Param("phaseStatus") String phaseStatus);

    List<Map<String, Object>> findDiscList( @Param("entity") PatentFindPatentListQuery entity,
                                            @Param("phaseStatusList") List<String> phaseStatusList,
                                            @Param("phaseStatus") String phaseStatus);

    String getLatestNodeName(@Param("disclosureId") Object disclosureId);

    // 二级报表查询节点为交底书专利文件列表
    IPage<Map<String, Object>> findPatentListPie(Page<Map<String, Object>> page,
                                              @Param("userId") Object userId,
                                              @Param("startDate") Object startDate,
                                              @Param("endDate") Object endDate,
                                              @Param("archivesNum") String archivesNum,
                                              @Param("phaseStatus") String phaseStatus,
                                              @Param("nodeIdList") List<String> nodeIdList,
                                              @Param("entity") PatentFindPatentListQuery entity);

    // 二级报表查询节点为交底书专利文件列表
    IPage<Map<String, Object>> findPatentDisclosureListPie(Page<Map<String, Object>> page,
                                                 @Param("userId") Object userId,
                                                 @Param("startDate") Object startDate,
                                                 @Param("endDate") Object endDate,
                                                 @Param("archivesNum") String archivesNum,
                                                 @Param("phaseStatus") String phaseStatus,
                                                 @Param("nodeIdList") List<String> nodeIdList,
                                                 @Param("entity") PatentFindPatentListQuery entity);

    //得到专利对应的主键id
    String getPatentId(@Param("num") String num);
    //交底书数据
    List<Map<String, Object>> findPatentListByDisclosure(@Param("userId") Object userId,
                                                         @Param("nodeList") List<String> nodeList,
                                                         @Param("startDate") Object startDate,
                                                         @Param("endDate") Object endDate,
                                                         @Param("archivesNum") String archivesNum);

    // 获取专利信息
    Map<String, Object> getPatentInfo(@Param("patentId") String patentId);

    //初审待审和终审待审
    List<Map<String, Object>> findReviewList(@Param("entity") PatentFindPatentListQuery entity, @Param("nodeList") List<String> nodeList);

//    List<Map<String, Object>> findPiePatentList(Object userId, @Param("nodeList") List<String> nodeList,
//                                                @Param("startDate") Object startDate, @Param("endDate") Object endDate,
//                                                @Param("archivesNum") String archivesNum,@Param("nodeList2") List<String> nodeList2 );

    //评审会相关
//    List<Map<String, Object>> findPieReviewMeetingList(Object userId, @Param("nodeList") List<String> nodeList,
//                                                       @Param("startDate") Object startDate, @Param("endDate") Object endDate,
//                                                       @Param("archivesNum") String archivesNum,List<String> nodeList2);

//    List<Map<String, Object>> findDiscListNotExsits(Object userId, @Param("nodeList") List<String> nodeList,
//                                                    @Param("startDate") Object startDate, @Param("endDate") Object endDate,
//                                                    @Param("archivesNum") String archivesNum,List<String> nodeList2);


    List<Map<String, Object>> findReviewListByGzjcs(@Param("userId") Object userId, @Param("phaseStatus") Object phaseStatus,
                                                    @Param("startDate") Object startDate,
                                                    @Param("endDate") Object endDate, @Param("archivesNum") String archivesNum,
                                                    @Param("nodeList") List<String> nodeList, @Param("num") Object num,
                                                    @Param("entity") PatentFindPatentListQuery entity);

    //得到节点名
    String getNodeName(@Param("phaseStatus") Object phaseStatus);


}